package com.springmvc.web.majiang.controller;

import org.springframework.beans.factory.annotation.Autowired;

import com.springmvc.netty.core.ActionMap;
import com.springmvc.netty.core.NettyController;
import com.springmvc.netty.message.Message;
import com.springmvc.web.majiang.entity.User;
import com.springmvc.web.majiang.service.IUserService;

import io.netty.channel.ChannelHandlerContext;

@NettyController()
public class UserAction {

	@Autowired
	private IUserService userService;

	@ActionMap(key = 1)
	public String login(ChannelHandlerContext ct, Message message) {
		User user = this.userService.selectById(1L);
		System.out.println(String.format("用户昵称:%s;密码%d;传人内容%s", user.getUsername(), user.getId(), message.getData()));
		return user.getUsername();
	}
}